package com.xidata.dict.client.embedded;

import lombok.Data;
import org.springframework.stereotype.Component;

@Component
@Data
public class TargetLanguageHolder {

    private static final ThreadLocal<String> TARGET_LANGUAGE = new ThreadLocal<>();

    public static void set(String language) {
        TARGET_LANGUAGE.set(language);
    }

    public static String get() {
        return TARGET_LANGUAGE.get();
    }

    public static void clear() {
        TARGET_LANGUAGE.remove();
    }
}
